package cn.t.web.android;

import cn.t.annotation.Runtime;
import cn.t.dto.android.DeviceFaultDTO;
import cn.t.facade.device.FaultFacade;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 设备端报警服务入口
 *
 * @author s
 * @since 2024-07-03
 */
@Slf4j
@RestController
@RequestMapping("runtime/fault")
// "安卓设备端报警服务")
@AllArgsConstructor
@Runtime
public class AndroidDeviceFaultController {

    private final FaultFacade facade;

    /**
     * 新增设备报警
     */
    @PostMapping("/add")
    public Boolean add(@Validated @RequestBody DeviceFaultDTO req) {
        return facade.add(req);
    }

}

